﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MGenScope
{
    public partial class EngineSettingsForm : Form
    {
        public EngineSettingsForm()
        {
            InitializeComponent();
        }
        public EngineSettings Settings { get; set; }
        private void buttonWorkingFolder_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fd = new FolderBrowserDialog();
            fd.SelectedPath = Settings.WorkingFolder;
            if (fd.ShowDialog() == DialogResult.OK)
                Settings.WorkingFolder = fd.SelectedPath;
        }

        private void EngineSettingsForm_Load(object sender, EventArgs e)
        {
            textBoxForce.DataBindings.Add(new Binding("Text", Settings, "ForceTemplate"));
            textBoxGetFen.DataBindings.Add(new Binding("Text", Settings, "GetFenTemplate"));
            textBoxMove.DataBindings.Add(new Binding("Text", Settings, "DoMoveTemplate"));
            textBoxInit.DataBindings.Add(new Binding("Text", Settings, "InitTemplate"));
            textBoxInitialPosition.DataBindings.Add(new Binding("Text", Settings, "SetInitialPositionTemplate"));
            textBoxSetFen.DataBindings.Add(new Binding("Text", Settings, "SetFenTemplate"));
            textBoxDivide.DataBindings.Add(new Binding("Text", Settings, "DivideTemplate"));
            textBoxWorkingFolder.DataBindings.Add(new Binding("Text", Settings, "WorkingFolder"));
            textBoxMoveRegex.DataBindings.Add(new Binding("Text",Settings,"ExtractMoveRegex"));
            textBoxMovesCountRegex.DataBindings.Add(new Binding("Text", Settings, "ExtractMovesCountRegex"));
            textBoxDivideEndRegex.DataBindings.Add(new Binding("Text", Settings, "EndDivideRegex"));
            textBoxFenRegex.DataBindings.Add(new Binding("Text", Settings, "FenRegex"));
            textBoxFenEndRegex.DataBindings.Add(new Binding("Text", Settings, "FenEndRegex"));
        }

        private void label10_Click(object sender, EventArgs e)
        {

        }
    }
}
